﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true"
    CodeFile="crm-agent-leads-assign.aspx.cs" Inherits="admin_crm_agent_leads_assign" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="smgrUser">
    </asp:ScriptManager>
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>
                        GG CRM Broker - Leads Assign</h1>
                </td>
            </tr>
            <asp:UpdatePanel ID="upnlGGBroker" runat="server">
                <ContentTemplate>
                    <asp:Panel ID="pnlBroker" runat="server">
                        <tr>
                            <td width="120">
                                <b>Broker</b>
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlUser" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlUser_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfvUSer" runat="server" ValidationGroup="leads" Display="Dynamic"
                                    InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large"
                                    ControlToValidate="ddlUser"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <table width="100%" cellpadding="3" cellspacing="3" border="0">
                                    <tr>
                                        <td width="120">
                                            <b>Email</b>
                                        </td>
                                        <td width="320">
                                            <asp:TextBox ID="txtEmail" runat="server" Width="300px" MaxLength="60" ReadOnly="true"></asp:TextBox>
                                        </td>
                                        <td width="120">
                                            <b>Campaign</b>
                                        </td>
                                        <td width="200">
                                            <asp:DropDownList ID="ddlCampaign" runat="server">
                                                <asp:ListItem Value="400" Selected="True">Online</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td colspan="2">&nbsp;</td>
                                        <%--<td width="120">
                                            <b>Lead Type</b>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlLeadType" runat="server">
                                                <asp:ListItem Value="-1">Select</asp:ListItem>
                                                <asp:ListItem Value="1">New Leads + Old Leads</asp:ListItem>
                                                <asp:ListItem Value="2">New Leads Only</asp:ListItem>
                                                <asp:ListItem Value="3">Old Leads Only</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvLeadType" runat="server" ValidationGroup="leads"
                                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                                Font-Size="X-Large" ControlToValidate="ddlLeadType"></asp:RequiredFieldValidator>
                                        </td>--%>
                                    </tr>
                                    <tr>
                                        <td width="120">
                                            <b>TH Name</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTHName" runat="server" Width="300px" MaxLength="60" ReadOnly="true"></asp:TextBox>
                                        </td>
                                        <td width="120">
                                            <b style="color: Red; font-size: larger;">Broker Level</b>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlBrokerLevel" runat="server" ForeColor="Red" Font-Bold="true" Enabled="false"
                                             AutoPostBack="true" OnSelectedIndexChanged="ddlBrokerLevel_SelectedIndexChanged">
                                                <asp:ListItem Value="-1">Select</asp:ListItem>
                                                <asp:ListItem Value="ONF">ONLINE FRESHER</asp:ListItem>
                                                <asp:ListItem Value="ONJ">ONLINE JUNIOR</asp:ListItem>
                                                <asp:ListItem Value="ONS">ONLINE SENIOR</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvBrokerLevel" runat="server" ValidationGroup="leads"
                                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                                Font-Size="X-Large" ControlToValidate="ddlBrokerLevel"></asp:RequiredFieldValidator>
                                        </td>                                        
                                        <td colspan="2">&nbsp;</td>
                                        <%--<td width="120">
                                            <b>Assign Old Leads</b>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlOldLeads" runat="server">
                                                <asp:ListItem Value="-1">Select</asp:ListItem>
                                                <asp:ListItem Value="1">Yes</asp:ListItem>
                                                <asp:ListItem Value="0">No</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvOldLeads" runat="server" ValidationGroup="leads"
                                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                                Font-Size="X-Large" ControlToValidate="ddlOldLeads"></asp:RequiredFieldValidator>
                                        </td>--%>
                                    </tr>
                                    <tr>
                                        <td width="120">
                                            <b>EN Name</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtENName" runat="server" Width="300px" MaxLength="60" ReadOnly="true"></asp:TextBox>
                                        </td>
                                        <td width="120">
                                            <b>Available Leads</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtAvailableLeads" runat="server" Width="50px" MaxLength="2" ReadOnly="true"
                                                Text="0"></asp:TextBox>
                                        </td>
                                        <td colspan="2">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td width="120">
                                            <b>Nick Name</b>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtNickName" runat="server" Width="300px" MaxLength="60" ReadOnly="true"></asp:TextBox>
                                        </td>
                                        <td width="120">
                                            <b>Lead Limit</b>
                                        </td>
                                        <td>
                                            
                                            <asp:DropDownList ID="ddlLeadLimit" runat="server"></asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="rfvLeadLimit" runat="server" ValidationGroup="leads"
                                                Display="Dynamic" InitialValue="-1" ErrorMessage="*" Text="" Font-Bold="true"
                                                Font-Size="X-Large" ControlToValidate="ddlLeadLimit"></asp:RequiredFieldValidator>
                                            <%--<asp:TextBox ID="txtLeadLimit" runat="server" Width="50px" MaxLength="2"></asp:TextBox>
                                            <asp:RequiredFieldValidator runat="server" ID="rfvLeadLimit" ControlToValidate="txtLeadLimit"
                                                ErrorMessage="*" Text="" Font-Bold="true" Font-Size="X-Large" ValidationGroup="leads"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator ID="revLeadLimite" runat="server" ControlToValidate="txtLeadLimit"
                                                Display="Dynamic" ValidationGroup="leads" ErrorMessage="Not Valid" Font-Bold="true" 
                                                ValidationExpression="^[0-9]+(\[0-9])?$"></asp:RegularExpressionValidator>
                                                <asp:RangeValidator runat="server" ID="rnvLeadLimit" Type="Integer" Font-Bold="true" ValidationGroup="leads"
                                                 ControlToValidate="txtLeadLimit" MaximumValue="20" MinimumValue="1" ErrorMessage="Allowed 1 to 20 only" />--%>
                                        </td>
                                        <td colspan="2">&nbsp;</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="btnSubmit" runat="server" Text="Submit" Width="80px" ValidationGroup="leads"
                                    OnClientClick="javascript:return SubmitConfirm();" OnClick="btnSubmit_Click" />&nbsp;
                                <asp:Button ID="btnClear" runat="server" Text="Clear" Width="80px" OnClick="btnClear_Click" />
                                <div style="display:none;">
                                    <asp:TextBox ID="txtAgentType" runat="server" Text="0"></asp:TextBox>
                                    <asp:TextBox ID="txtFreshLeadLimit" runat="server" Text="0"></asp:TextBox>
                                    <asp:TextBox ID="txtUncontactLeadLimit" runat="server" Text="0"></asp:TextBox>
                                    <asp:TextBox ID="txtLastYearLeadLimit" runat="server" Text="0"></asp:TextBox>
                                    <asp:TextBox ID="txtDateToDelete" runat="server" Text="6"></asp:TextBox>
                                    <asp:TextBox ID="txtONJPercentage" runat="server" Text="35"></asp:TextBox>
                                    <asp:TextBox ID="txtCheckActivity" runat="server" Text="0"></asp:TextBox>
                                    <asp:TextBox ID="txtIsRunNewLead" runat="server" Text="1"></asp:TextBox>
                                    <asp:TextBox ID="txtIsRunUnContactedLead" runat="server" Text="1"></asp:TextBox>
                                    <asp:TextBox ID="txtIsRunOLDLead" runat="server" Text="1"></asp:TextBox>
                                    <asp:TextBox ID="txtIsTesting" runat="server" Text="0"></asp:TextBox>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Label runat="server" ID="lblError" ForeColor="Red" Font-Bold="true" Font-Size="Large"></asp:Label>
                            </td>
                        </tr>
                    </asp:Panel>
                    <asp:Panel ID="pnlMessage" runat="server" Visible="false">
                        <tr>
                            <td colspan="2">
                                <asp:Label runat="server" ID="lblLeadMessage" ForeColor="Green" Font-Bold="true"
                                    Font-Size="Large"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="btnView" runat="server" Text="VIEW" Width="80px" OnClick="btnView_Click" />
                            </td>
                        </tr>
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
        </table>
    </div>

    <script type="text/javascript">

        function SubmitConfirm() {
            var _retVal = false;
            if (Page_ClientValidate('leads')) {
                _retVal = window.confirm('Are you sure to ASSIGN LEADS?');
            }
            return _retVal;
        }

    </script>

</asp:Content>
